;安装时写入
!macro customInstall
    WriteRegStr HKCR "*\shell\ai-comment-read" "" "ai-comment"
    WriteRegStr HKCR "*\shell\ai-comment-read" "Icon" "$INSTDIR\ai-comment.exe"
    WriteRegStr HKCR "*\shell\ai-comment-read\command" "" '"$INSTDIR\ai-comment.exe" "read" "%1"'
    WriteRegStr HKCR "*\shell\ai-comment-upload" "" "ai-comment"
    WriteRegStr HKCR "*\shell\ai-comment-upload" "Icon" "$INSTDIR\ai-comment.exe"
    WriteRegStr HKCR "*\shell\ai-comment-upload\command" "" '"$INSTDIR\ai-comment.exe" "upload" "%1"'
!macroend
;卸载时清除
!macro customUninstall
    DeleteRegKey HKCR "*\shell\ai-comment-read"
    DeleteRegKey HKCR "*\shell\ai-comment-upload"
!macroend

;修改默认安装路径
!macro preInit
    SetRegView 64
    WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\ai-comment"
    WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\ai-comment"
    SetRegView 32
    WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\ai-comment"
    WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\ai-comment"
!macroend
